*Code used to create each figure and table included in the Corporate Taxes and Initial Public Offerings: Evidence from the Tax Cuts and Jobs Act
*Authors: Michelle Hutchens and Alexander Edwards
*Data Analysis completed by Michelle Hutchens

*Figures 1 and 2 (figures created in excel)
sort year
by year: summarize logop2sales2 llrp2s

*Figures 3 and 4 (figures created in excel)
summarize percshares_w if post==1, detail
summarize percshares_w if during_elect==1, detail
summarize percshares_w if post==0 & during_elect==0, detail

summarize days_orig2issue_w if post==1, detail
summarize days_orig2issue_w if during_elect==1, detail
summarize days_orig2issue_w if post==0 & during_elect==0, detail


*Table 1 Descriptive Statistics by Period
tabstat logop2sales2 llrp2s ind_dtl domestic lowlev grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w if post==1, stat(n, mean, sd, p5, p50, p95)
tabstat logop2sales2 llrp2s ind_dtl domestic lowlev grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w if during_elect==1, stat(n, mean, sd, p5, p50, p95)
tabstat logop2sales2 llrp2s ind_dtl domestic lowlev grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w if post==0 & during_elect==0, stat(n, mean, sd, p5, p50, p95)

sort post
ttest logop2sales2 if during_elect==0, by(post)
ttest llrp2s if during_elect==0, by(post)
ttest ind_dtl if during_elect==0, by(post)
ttest domestic if during_elect==0, by(post)
ttest lowlev if during_elect==0, by(post)
ttest grossspread_perc1_w if during_elect==0, by(post)
ttest proceeds1_w if during_elect==0, by(post)
ttest mktret_w if during_elect==0, by(post)
ttest iporet_w if during_elect==0, by(post)
ttest ipotot_w if during_elect==0, by(post)
ttest indrank if during_elect==0, by(post)
ttest BIGN if during_elect==0, by(post)
ttest vc if during_elect==0, by(post)
ttest logage if during_elect==0, by(post)
ttest revision_w if during_elect==0, by(post)

sort during_elect
ttest logop2sales2 if post==0, by(during_elect)
ttest llrp2s if post==0, by(during_elect)
ttest ind_dtl if post==0, by(during_elect)
ttest domestic if post==0, by(during_elect)
ttest lowlev if post==0, by(during_elect)
ttest grossspread_perc1_w if post==0, by(during_elect)
ttest proceeds1_w if post==0, by(during_elect)
ttest mktret_w if post==0, by(during_elect)
ttest iporet_w if post==0, by(during_elect)
ttest ipotot_w if post==0, by(during_elect)
ttest indrank if post==0, by(during_elect)
ttest BIGN if post==0, by(during_elect)
ttest vc if post==0, by(during_elect)
ttest logage if post==0, by(during_elect)
ttest revision_w if post==0, by(during_elect)

*Table 2 
robreg m logop2sales2 post during_elect grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w i.ffi12, vce(cl quarteryear) 
outreg2 using eh.xls, tstat bdec(3) tdec(2) e(r2_p) replace /*table 2 column 1*/ 
robreg m llrp2s post during_elect grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w i.ffi12, vce(cl quarteryear) 
outreg2 using eh.xls, tstat bdec(3) tdec(2) e(r2_p) append /*table 2 column 2*/ 

*Table 3
robreg m logop2sales2 post##ind_dtl during_elect##ind_dtl grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w i.ffi12, vce(cl quarteryear) 
test _b[1.post]+_b[1.post#1.ind_dtl]=0
test _b[1.during_elect]+_b[1.during_elect#1.ind_dtl]=0
outreg2 using eh.xls, tstat bdec(3) tdec(2) e(r2_p) replace
robreg m logop2sales2 post##domestic during_elect##domestic grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w i.ffi12, vce(cl quarteryear) 
test _b[1.post]+_b[1.post#1.domestic]=0
test _b[1.during_elect]+_b[1.during_elect#1.domestic]=0
outreg2 using eh.xls, tstat bdec(3) tdec(2) e(r2_p) append
robreg m logop2sales2 post##lowlev during_elect##lowlev grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w i.ffi12, vce(cl quarteryear) 
test _b[1.post]+_b[1.post#1.lowlev]=0
test _b[1.during_elect]+_b[1.during_elect#1.lowlev]=0
outreg2 using eh.xls, tstat bdec(3) tdec(2) e(r2_p) append

*Table 4
reghdfe reviseup2 post during_elect grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage salespershare_w, absorb(ffi12) cluster(quarteryear) 
outreg2 using eh.xls, tstat bdec(3) tdec(2) replace

*Table 5
reghdfe reviseup2 post##indrank during_elect##indrank grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w BIGN vc logage salespershare_w, absorb(ffi12) cluster(quarteryear) 
outreg2 using eh.xls, tstat bdec(3) tdec(2) replace
robreg m logop2sales2 post##indrank during_elect##indrank grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w i.ffi12, vce(cl quarteryear) 
test _b[1.post]+_b[1.post#1.indrank]=0
test _b[1.during_elect]+_b[1.during_elect#1.indrank]=0
outreg2 using eh.xls, tstat bdec(3) tdec(2) e(r2_p) append
robreg m llrp2s post##indrank during_elect##indrank grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w i.ffi12, vce(cl quarteryear) 
test _b[1.post]+_b[1.post#1.indrank]=0
test _b[1.during_elect]+_b[1.during_elect#1.indrank]=0
outreg2 using eh.xls, tstat bdec(3) tdec(2) e(r2_p) append

*Table 6
reghdfe reviseup2 post##high_prisk during_elect##high_prisk grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w BIGN vc logage salespershare_w, absorb(ffi12) cluster(quarteryear) 
outreg2 using eh.xls, tstat bdec(3) tdec(2) replace
robreg m logop2sales2 post##high_prisk during_elect##high_prisk grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w i.ffi12, vce(cl quarteryear) 
test _b[1.post]+_b[1.post#1.high_prisk]=0
test _b[1.during_elect]+_b[1.during_elect#1.high_prisk]=0
outreg2 using eh.xls, tstat bdec(3) tdec(2) e(r2_p) append
robreg m llrp2s post##high_prisk during_elect##high_prisk grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w i.ffi12, vce(cl quarteryear) 
test _b[1.post]+_b[1.post#1.high_prisk]=0
test _b[1.during_elect]+_b[1.during_elect#1.high_prisk]=0
outreg2 using eh.xls, tstat bdec(3) tdec(2) e(r2_p) append


*Table 7
mlogit period ind_dtl domestic lowlev salespershare_w bvps_w grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w indy1-indy10, base(3) vce(cl quarteryear)
outreg2 using eh.xls, tstat bdec(3) tdec(2) replace /*note post and during don't have observations in industries 9 or 12*/

*Table 8
ebalance post ind_dtl domestic lowlev bvps_w indrank BIGN vc logage i.ffi12 if during_elect==0, target(3)

reghdfe logop2sales2 post grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w [pweight=_webal], absorb(ffi12) cluster(quarteryear) 
display "R2 = " e(r2)
outreg2 using eh.xls, tstat bdec(3) tdec(2) replace
reghdfe llrp2s post grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w [pweight=_webal], absorb(ffi12) cluster(quarteryear) 
display "R2 = " e(r2)
outreg2 using eh.xls, tstat bdec(3) tdec(2) append
reghdfe logop2sales2 post##ind_dtl grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w [pweight=_webal], absorb(ffi12) cluster(quarteryear)
display "R2 = " e(r2)
test _b[1.post]+_b[1.post#1.ind_dtl]=0
outreg2 using eh.xls, tstat bdec(3) tdec(2) append
reghdfe logop2sales2 post##domestic grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w [pweight=_webal], absorb(ffi12) cluster(quarteryear) 
display "R2 = " e(r2)
test _b[1.post]+_b[1.post#1.domestic]=0
outreg2 using eh.xls, tstat bdec(3) tdec(2) append
reghdfe logop2sales2 post##lowlev grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w [pweight=_webal], absorb(ffi12) cluster(quarteryear) 
display "R2 = " e(r2)
test _b[1.post]+_b[1.post#1.lowlev]=0
outreg2 using eh.xls, tstat bdec(3) tdec(2) append

*Table 9
ebalance during_elect ind_dtl domestic lowlev bvps_w indrank BIGN vc logage i.ffi12 if post==0, target(2) /*note unable to balance on skewness*/

reghdfe logop2sales2 during_elect grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w [pweight=_webal], absorb(ffi12) cluster(quarteryear) 
display "R2 = " e(r2)
outreg2 using eh.xls, tstat bdec(3) tdec(2) replace
reghdfe llrp2s during_elect grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w [pweight=_webal], absorb(ffi12) cluster(quarteryear) 
display "R2 = " e(r2)
outreg2 using eh.xls, tstat bdec(3) tdec(2) append
reghdfe logop2sales2 during_elect##ind_dtl grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w [pweight=_webal], absorb(ffi12) cluster(quarteryear)
display "R2 = " e(r2)
test _b[1.during_elect]+_b[1.during_elect#1.ind_dtl]=0
outreg2 using eh.xls, tstat bdec(3) tdec(2) append
reghdfe logop2sales2 during_elect##domestic grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w [pweight=_webal], absorb(ffi12) cluster(quarteryear) 
display "R2 = " e(r2)
test _b[1.during_elect]+_b[1.during_elect#1.domestic]=0
outreg2 using eh.xls, tstat bdec(3) tdec(2) append
reghdfe logop2sales2 during_elect##lowlev grossspread_perc1_w proceeds1_w mktret_w iporet_w ipotot_w indrank BIGN vc logage revision_w [pweight=_webal], absorb(ffi12) cluster(quarteryear) 
display "R2 = " e(r2)
test _b[1.during_elect]+_b[1.during_elect#1.lowlev]=0
outreg2 using eh.xls, tstat bdec(3) tdec(2) append


*Table 10
*Table 10 uses a separate data file pulled from SDC to include IPOs of firms located in the United Kingdom and Eurozone. Data compilation procedures were the same with both files.
robreg m logop2sales2 post##ind_us during_elect##ind_us proceeds1_w mktret_w iporet_w ipotot_w vc nationindicate1-nationindicate21 i.ffi12, vce(cl quarteryear)
test _b[1.post]+_b[1.post#1.ind_us]=0
test _b[1.during_elect]+_b[1.during_elect#1.ind_us]=0
outreg2 using eh.xls, tstat bdec(3) tdec(2) e(r2_p) replace


